<?php

namespace mpend\modules\search\models;

use Yii;

/**
 * 热搜词条模型
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class HotWordSearch extends \common\models\keyword\KeywordLibrary {

    /**
     * @var integer Pagesize.
     */
    public $pagesize = false;

    /**
     * @var integer Page limit.
     */
    public $limitSize = 10;

    /**
     * @return \common\db\ActiveQuery 
     */
    public function buildQuery() {
        return static::find()->orderBy([
            'spread_at' => SORT_DESC,
            'times' => SORT_DESC,
            'updated_at' => SORT_DESC,
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function fields() {
        return [
            'id',
            'text',
        ];
    }

}
